package com.wangtongxiao.mapper;

import java.io.File;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

public class MyIo {
    public static void main(String[] args) {

        String path = "d:\\abc.txt";
        File file = new File(path);
        System.out.println( file.isDirectory());
        System.out.println(file.isFile());
        System.out.println(file.length());
        System.out.println(file.getTotalSpace());
        System.out.println(file.getUsableSpace());
        System.out.println(file.getFreeSpace());
        System.out.println(file.lastModified());
        Instant instant = Instant.ofEpochMilli(file.lastModified());
        ZonedDateTime zonedDateTime = instant.atZone(ZoneId.systemDefault());
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String format = zonedDateTime.format(dateTimeFormatter);
        System.out.println(format);



    }
}
